package com.xxkk.mvc.control;

//import gmPayServer.GMPayServer;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xxkk.mvc.service.SqlService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Base64;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicLong;

@Controller
@CrossOrigin
@RequestMapping(value = "/upload")
public class ImgUp {

    @Autowired
    private SqlService sqlService;

    private static final Logger logger = Logger.getLogger(ImgUp.class);

    @CrossOrigin
    @RequestMapping("/img")
    @ResponseBody
    public String img(@RequestBody Map<String, Object> paramMap) {//, @RequestHeader("token") String token @RequestBody Map<String, Object> paramMap,
        try{
            logger.info("xxkk");
//            logger.info(paramMap);
            JSONObject jsonObject = new JSONObject();
            jsonObject.putAll(paramMap);
            JSONArray array = jsonObject.getJSONArray("img");
            logger.info(array.size());
        }catch (Exception e){
            e.printStackTrace();
        }
        return "{'data':'success'}";
    }

}
